<template>
    <div class='Outsidemining'>
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" size="mini" label-width="160px" class="demo-ruleForm">
            <div style="display:flex;">
                <el-form-item label="手机号">
                    <el-input v-model="phoneNum.phone" placeholder="请输入手机号查询会员信息"></el-input>
                </el-form-item>
                <el-form-item prop="name">
                    <el-button type="primary" @click="query">查询</el-button>
                </el-form-item>
                <el-form-item label="城市名称" prop="cityName">
                    <el-input v-model="ruleForm.cityName"></el-input>
                </el-form-item>
            </div>
            <!-- 新接口内容 -->
            <div style="display:flex;">
                <el-form-item label="酒店名称" prop="HotelName">
                    <el-input type="textarea" :rows="1" v-model="ruleForm.HotelName"></el-input>
                </el-form-item>
                <el-form-item label="房型名称" prop="roomTypeName">
                    <el-input v-model="ruleForm.roomTypeName"></el-input>
                </el-form-item>
                <el-form-item label="早餐数量" prop="breakfast">
                    <el-input v-model="ruleForm.breakfast"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店星级" prop="hotelstar">
                    <el-input v-model="ruleForm.hotelstar"></el-input>
                </el-form-item>
                <el-form-item label="入住时间" prop="ArrivalDate">
                    <el-date-picker type="date" style="width:183px;" placeholder="入住时间" v-model="ruleForm.ArrivalDate"
                        value-format="yyyy-MM-dd">
                    </el-date-picker>
                </el-form-item>
                <el-form-item label="离店时间" prop="DepartureDate">
                    <el-date-picker type="date" style="width:183px;" placeholder="离店时间" v-model="ruleForm.DepartureDate"
                        value-format="yyyy-MM-dd">
                    </el-date-picker>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="联系人电话" prop="Mobile">
                    <el-input oninput="value=value.replace(/[^\d.]/g,'')" v-model="ruleForm.Mobile"></el-input>
                </el-form-item>
                <el-form-item label="客人数量" prop="NumberOfCustomers">
                    <el-input oninput="value=value.replace(/[^\d.]/g,'')" v-model="ruleForm.NumberOfCustomers">
                    </el-input>
                </el-form-item>
                <el-form-item label="房间数量" prop="NumberOfRooms">
                    <el-input v-model="ruleForm.NumberOfRooms"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="支付类型" prop="PaymentType">
                    <el-select style="width:183px;" v-model="ruleForm.PaymentType" placeholder="请选择支付类型">
                        <el-option label="预付" value="Prepay"></el-option>
                        <el-option label="现付" value="SelfPay"></el-option>
                    </el-select>
                </el-form-item>
                <el-form-item label="最早到店时间" prop="EarliestArrivalTime">
                    <el-time-select style="width:183px;" v-model="ruleForm.EarliestArrivalTime" :picker-options="{
                      start: '01:00', step: '00:30',  end: '24:00' }" placeholder="选择最早到店时间">
                    </el-time-select>
                </el-form-item>
                <el-form-item label="最晚到店时间" prop="LatestArrivalTime">
                    <el-time-select style="width:183px;" v-model="ruleForm.LatestArrivalTime" :picker-options="{
                      start: '01:00', step: '00:30',  end: '24:00' }" placeholder="选择最晚到店时间">
                    </el-time-select>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="订单总金额" prop="totalsalePrice">
                    <el-input v-model="ruleForm.totalsalePrice"></el-input>
                </el-form-item>
                <el-form-item label="">
                    <el-button type="primary" size="mini" @click="nameadd">添加入住人</el-button>
                    <span style="color:red;font-size:18px;">注：识别出的入住人不得修改、添加及删除</span>
                </el-form-item>
                <el-form-item label="入住人姓名" prop="fullName" v-for="(item,index) in ruleForm.Customers" :key="index">
                    <div style="display:flex;">
                        <el-input v-model="item.name"></el-input>
                        <el-button type="primary" @click="namedel(item,index)">删除</el-button>
                    </div>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item prop="valueAdds" v-if="ruleForm.invoiceInfo!='如需要发票，可向酒店索取（发票金额不包含礼品卡支付的部分）'">
                    <el-checkbox v-model="ruleForm.IsNeedInvoice">需要发票</el-checkbox>
                </el-form-item>
                <el-form-item label="发票" v-if="ruleForm.invoiceInfo=='如需要发票，可向酒店索取（发票金额不包含礼品卡支付的部分）'">
                    <el-input style="width:500px;" v-model="ruleForm.invoiceInfo"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;" v-if="ruleForm.IsNeedInvoice==true">
                <el-form-item label="发票抬头">
                    <el-input size="mini" v-model="ruleForm.invoiceTitle" @change="changeData" autocomplete="off">
                    </el-input>
                </el-form-item>
                <el-form-item label="电话">
                    <el-input size="mini" v-model="ruleForm.companyRegisterTell" autocomplete="off"></el-input>
                </el-form-item>
                <el-form-item label="邮箱">
                    <el-input size="mini" v-model="ruleForm.email" autocomplete="off"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="入住时长" prop="moneyItemInfotitle">
                    <el-input type="textarea" :rows="1" size="mini" v-model="ruleForm.moneyItemInfotitle"
                        placeholder="格式1间 x 1晚（必须按照格式填写）" style="width:800px;">
                    </el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店地址" prop="address">
                    <el-input type="textarea" :rows="1" size="mini" v-model="ruleForm.address" style="width:800px;">
                    </el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="第三方订单号" prop="AffiliateConfirmationId">
                    <el-input type="textarea" :rows="1" size="mini" v-model="ruleForm.AffiliateConfirmationId"
                        style="width:800px;">
                    </el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="酒店电话" prop="phone">
                    <el-input type="textarea" :rows="1" size="mini" v-model="ruleForm.phone" style="width:800px;">
                    </el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="取消政策">
                    <el-input type="textarea" :rows="2" size="mini" v-model="ruleForm.punishmentDesc"
                        style="width:800px;"></el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="是否确认">
                    <el-input type="textarea" :rows="2" size="mini" v-model="ruleForm.content" style="width:800px;">
                    </el-input>
                </el-form-item>
            </div>
            <div style="display:flex;">
                <el-form-item label="是否支付全部房费">
                    <el-input type="textarea" :rows="2" size="mini" v-model="ruleForm.payInfoDesc" style="width:800px;">
                    </el-input>
                </el-form-item>
            </div>
            <el-form-item>
                <el-button type="primary" @click="submitForm('ruleForm')">立即创建</el-button>
            </el-form-item>
        </el-form>
        <el-tabs v-model="activeName" @tab-click="handleClick">
            <el-tab-pane label="支付订单" name="zf">
                <el-input type="textarea" @input="textareainput" :rows="20" placeholder="请输入支付后的订单内容" v-model="textarea"></el-input>
            </el-tab-pane>
            <el-tab-pane label="未支付订单" name="wzf">
                <el-input type="textarea" @input="textareainputnot" :rows="20" placeholder="请输入未支付的订单内容" v-model="Didnotpayorder"></el-input>
            </el-tab-pane>
        </el-tabs>
        <!-- 识别酒店信息 -->
            <!--
        <el-input type="textarea" @input="textareainput" :rows="20" placeholder="请输入内容" v-model="textarea">
        </el-input> -->
    </div>
</template>

<script>
    export default {
        name: 'Outsidemining',
        data() {
            //这里存放数据
            return {
                Didnotpayorder:"",
                activeName: "zf",
                huiyuan: {},
                dfghdfdList: "",
                dfghdfd: "",
                customerId: null,
                name: "",
                radio1: false,
                // 酒店信息
                hotelDetail: {},
                textarea: "",
                // 会员
                phoneNum: {
                    phone: "",
                },
                ruleForm: {
                    sourceTypeName: 'Crm',
                    ConfirmationType: "NoNeed",
                    address: "",
                    RatePlanId: 0,
                    HotelId: 0,
                    RoomTypeId: 0,
                    customerId: null,
                    HotelName: "",
                    invoiceTitle: "",
                    companyRegisterTell: "",
                    email: "",
                    // 发票
                    IsNeedInvoice: false,
                    roomTypeName: "",
                    breakfast: "",
                    hotelstar: "",
                    ArrivalDate: "",
                    Mobile: "",
                    DepartureDate: "",
                    cityName: "",
                    NumberOfCustomers: "",
                    NumberOfRooms: "",
                    PaymentType: "",
                    LatestArrivalTime: "",
                    EarliestArrivalTime: "",
                    totalsalePrice: null,
                    CurrencyCode: 'RMB',
                    Customers: [],
                    // 取消政策 
                    punishmentDesc: "",
                    // 是否确认
                    content: "",
                    // 酒店电话
                    phone: "",
                    // 发票信息
                    invoiceInfo: '',
                    // 是否支付全部房费
                    payInfoDesc: "",
                    // 第三方订单号
                    AffiliateConfirmationId: "",
                    // 入住人姓名
                    moneyItemInfo: "",
                    moneyItemInfotitle: "",
                    hotelEnum: 'outerPick',
                    TotalPrice: null
                },
                // 校验
                rules: {
                    cityName: [{
                        required: true,
                        message: '请输入城市名称',
                        trigger: 'blur'
                    }, ],
                    HotelName: [{
                        required: true,
                        message: '请输入酒店名称',
                        trigger: 'blur'
                    }, ],
                    roomTypeName: [{
                        required: true,
                        message: '请输入房型名称',
                        trigger: 'blur'
                    }, ],
                    breakfast: [{
                        required: true,
                        message: '请输入早餐数量',
                        trigger: 'blur'
                    }, ],
                    hotelstar: [{
                        required: true,
                        message: '请输入酒店星级',
                        trigger: 'blur'
                    }, ],
                    ArrivalDate: [{
                        required: true,
                        message: '请选择入住时间',
                        trigger: 'change'
                    }, ],

                    DepartureDate: [{
                        required: true,
                        message: '请选择离店时间',
                        trigger: 'change'
                    }, ],
                    Mobile: [{
                        required: true,
                        message: '请输入联系人电话',
                        trigger: 'blur'
                    }, ],
                    NumberOfCustomers: [{
                        required: true,
                        message: '请输入客人数量',
                        trigger: 'blur'
                    }, ],
                    NumberOfRooms: [{
                        required: true,
                        message: '请输入房间数量',
                        trigger: 'blur'
                    }, ],
                    PaymentType: [{
                        required: true,
                        message: '请选择支付类型',
                        trigger: 'change'
                    }, ],
                    EarliestArrivalTime: [{
                        required: true,
                        message: '请选择最早到店时间',
                        trigger: 'change'
                    }, ],
                    LatestArrivalTime: [{
                        required: true,
                        message: '请选择最晚到店时间',
                        trigger: 'change'
                    }, ],
                    totalsalePrice: [{
                        required: true,
                        message: '请输入订单总金额',
                        trigger: 'blur'
                    }, ],

                    cityName: [{
                        required: true,
                        message: '请输入城市名称',
                        trigger: 'blur'
                    }, ],
                    cityName: [{
                        required: true,
                        message: '请输入城市名称',
                        trigger: 'blur'
                    }, ],
                    cityName: [{
                        required: true,
                        message: '请输入城市名称',
                        trigger: 'blur'
                    }, ],
                    moneyItemInfotitle: [{
                        required: true,
                        message: '请输入入住时长',
                        trigger: 'blur'
                    }, ],
                    address: [{
                        required: true,
                        message: '请输入酒店地址',
                        trigger: 'blur'
                    }, ],
                    AffiliateConfirmationId: [{
                        required: true,
                        message: '请输入第三方订单号',
                        trigger: 'blur'
                    }, ],
                    phone: [{
                        required: true,
                        message: '请输入酒店电话',
                        trigger: 'blur'
                    }, ],
                }
            }
        },
        components: {},
        //方法集合
        methods: {
            handleClick() {
                console.log(this.activeName)
                if(this.activeName=='zf'){
                    this.Didnotpayorder=''
                    this.ruleForm.sourceTypeName= 'Crm',
                    this.ruleForm.ConfirmationType= 'NoNeed',
                    this.ruleForm.address='',
                    this.ruleForm.RatePlanId=0,
                    this.ruleForm.HotelId=0,
                    this.ruleForm.RoomTypeId=0,
                    this.ruleForm.customerId=null,
                    this.ruleForm.HotelName='',
                    this.ruleForm.invoiceTitle='',
                    this.ruleForm.companyRegisterTell='',
                    this.ruleForm.email='',
                    this.ruleForm.IsNeedInvoice=false,
                    this.ruleForm.roomTypeName='',
                    this.ruleForm.breakfast='',
                    this.ruleForm.hotelstar='',
                    this.ruleForm.ArrivalDate='',
                    this.ruleForm.Mobile='',
                    this.ruleForm.DepartureDate='',
                    this.ruleForm.cityName='',
                    this.ruleForm.NumberOfCustomers='',
                    this.ruleForm.NumberOfRooms=false,
                    this.ruleForm.PaymentType='',
                    this.ruleForm.LatestArrivalTime='',
                    this.ruleForm.EarliestArrivalTime='',
                    this.ruleForm.totalsalePrice=null,
                    this.ruleForm.CurrencyCode='RMB',
                    this.ruleForm.Customers=[],
                    this.ruleForm.punishmentDesc='',
                    this.ruleForm.content='',
                    this.ruleForm.phone='',
                    this.ruleForm.invoiceInfo='',
                    this.ruleForm.payInfoDesc='',
                    this.ruleForm.AffiliateConfirmationId='',
                    this.ruleForm.moneyItemInfo='',
                    this.ruleForm.moneyItemInfotitle='',
                    this.ruleForm.hotelEnum='outerPick',
                    this.ruleForm.TotalPrice=null
                }else{
                    this.textarea=''
                    this.ruleForm.sourceTypeName= 'Crm',
                    this.ruleForm.ConfirmationType= 'NoNeed',
                    this.ruleForm.address='',
                    this.ruleForm.RatePlanId=0,
                    this.ruleForm.HotelId=0,
                    this.ruleForm.RoomTypeId=0,
                    this.ruleForm.customerId=null,
                    this.ruleForm.HotelName='',
                    this.ruleForm.invoiceTitle='',
                    this.ruleForm.companyRegisterTell='',
                    this.ruleForm.email='',
                    this.ruleForm.IsNeedInvoice=false,
                    this.ruleForm.roomTypeName='',
                    this.ruleForm.breakfast='',
                    this.ruleForm.hotelstar='',
                    this.ruleForm.ArrivalDate='',
                    this.ruleForm.Mobile='',
                    this.ruleForm.DepartureDate='',
                    this.ruleForm.cityName='',
                    this.ruleForm.NumberOfCustomers='',
                    this.ruleForm.NumberOfRooms=false,
                    this.ruleForm.PaymentType='',
                    this.ruleForm.LatestArrivalTime='',
                    this.ruleForm.EarliestArrivalTime='',
                    this.ruleForm.totalsalePrice=null,
                    this.ruleForm.CurrencyCode='RMB',
                    this.ruleForm.Customers=[],
                    this.ruleForm.punishmentDesc='',
                    this.ruleForm.content='',
                    this.ruleForm.phone='',
                    this.ruleForm.invoiceInfo='',
                    this.ruleForm.payInfoDesc='',
                    this.ruleForm.AffiliateConfirmationId='',
                    this.ruleForm.moneyItemInfo='',
                    this.ruleForm.moneyItemInfotitle='',
                    this.ruleForm.hotelEnum='outerPick',
                    this.ruleForm.TotalPrice=null
                }
            },
            //跳出
            closeLoading() {
                this.tableLoading.close();
            },
            //进入
            showLoading() {
                this.tableLoading = this.$loading({
                    text: "拼命加载数据中", //显示在加载图标下方的加载文案
                    spinner: "el-icon-loading", //自定义加载图标类名
                    background: "rgba(0, 0, 0, 0.4)", //遮罩层颜色
                    target: document.querySelector("#table"), //loadin覆盖的dom元素节点
                });
            },
            // 截取房间数量
            ItemInfotitle(index) {
                // debugger
                let ss = index
                let aa = ss.split(" x ")
                let qq = aa[1].substring(0, 1)
                return qq
            },
            // 截取入住时间离店时间
            time(index) {
                var a = index.split('/')
                var b = a[0] + '-' + a[1] + '-' + a[2]
                var c = b.split(' ')
                var d = c[0]
                console.log(d)
                return d
            },
            // 添加入住入住人按钮
            nameadd() {
                let arr = {
                    name: ''
                }
                this.ruleForm.Customers.push(arr)
            },
            namedel(item, index) {
                this.ruleForm.Customers.splice(index, 1);
            },
            // 截取酒店信息__webpack_public_path__之后的所有
            getCaption(obj, text) {
                let index = obj.lastIndexOf(text) + text.length - 1;
                obj = obj.substring(index + 1, obj.length);
                return obj;
            },
            // 获取酒店信息 未支付
            textareainputnot(row){
                let w = this.getCaption(row, '.IBU_HOTEL=')
                var a = w.indexOf("__webpack_public_path__")
                var l = w.substring(0, a);
                let b = l.indexOf(";")
                var f = w.substring(0, b);
                console.log(f)
                var dataObj = JSON.parse(f);
                console.log(dataObj)
                this.hotelDetail = dataObj
                console.log(this.hotelDetail.initData)
                this.ruleForm.HotelName = this.hotelDetail.initData.hotelDetail.name
                this.ruleForm.roomTypeName = this.hotelDetail.initData.hotelDetail.room
                this.ruleForm.breakfast = this.hotelDetail.initData.hotelDetail.detailInfoList[2].value
                if (this.ruleForm.breakfast == '无早餐') {
                    this.ruleForm.breakfast = 0
                }
                this.ruleForm.cityName = this.hotelDetail.initData.hotelDetail.cityName
                if(this.hotelDetail.initData.cancellationPolicyInfo){
                this.ruleForm.punishmentDesc = this.hotelDetail.initData.cancellationPolicyInfo.punishmentDesc
                }
                this.ruleForm.content = this.hotelDetail.initData.orderStatus.description
                this.ruleForm.phone = this.hotelDetail.initData.hotelDetail.tel
                this.ruleForm.invoiceInfo = this.hotelDetail.initData.invoiceInfo.state
                this.ruleForm.totalsalePrice = this.hotelDetail.initData.money.total
                console.log(this.hotelDetail.initData.money.payInfo)
                if (this.hotelDetail.initData.money.payInfo == '在线付') {
                    this.ruleForm.PaymentType = 'Prepay'
                } else {
                    this.ruleForm.PaymentType = 'SelfPay'
                }
                this.ruleForm.payInfoDesc = this.hotelDetail.initData.money.payInfoDesc
                this.ruleForm.moneyItemInfotitle = this.hotelDetail.initData.money.moneyItemInfo[0].title
                this.ruleForm.NumberOfRooms = this.hotelDetail.initData.orderInfo.list[0].text
                this.ruleForm.AffiliateConfirmationId = this.hotelDetail.initData.orderInfo.orderID
                this.ruleForm.ArrivalDate = this.time(this.hotelDetail.initData.orderInfo.checkInString)
                this.ruleForm.DepartureDate = this.time(this.hotelDetail.initData.orderInfo.checkOutString)
                this.ruleForm.Mobile = this.hotelDetail.initData.guestInfo.contact.phoneNum
                this.ruleForm.Customers = this.hotelDetail.initData.guestInfo.userInfo
                this.ruleForm.Customers.forEach(item => {
                    item.name = item.fullName
                    delete item.fullName
                })
                this.ruleForm.NumberOfCustomers = this.ruleForm.Customers.length
                this.ruleForm.hotelstar = this.hotelDetail.initData.hotelDetail.star
                this.ruleForm.address = this.hotelDetail.initData.hotelDetail.address
                console.log(this.ruleForm.totalsalePrice)
                console.log(this.ItemInfotitle(this.ruleForm.moneyItemInfotitle))
                console.log(this.ruleForm.NumberOfRooms)
                this.ruleForm.TotalPrice = (this.hotelDetail.initData.money.moneyItemInfo[0].price) / (this
                    .ItemInfotitle(this.ruleForm.moneyItemInfotitle)) / this.ruleForm.NumberOfRooms
                console.log(this.ruleForm.TotalPrice)
            },
            // 获取酒店信息信息支付完
            textareainput(row) {
                let w = this.getCaption(row, '.IBU_HOTEL=')
                var a = w.indexOf("__webpack_public_path__")
                var l = w.substring(0, a);
                let b = l.indexOf(";")
                var f = w.substring(0, b);
                console.log(f)
                var dataObj = JSON.parse(f);
                console.log(dataObj)
                this.hotelDetail = dataObj
                console.log(this.hotelDetail.initData)
                this.ruleForm.HotelName = this.hotelDetail.initData.hotelDetail.name
                this.ruleForm.roomTypeName = this.hotelDetail.initData.hotelDetail.room
                this.ruleForm.breakfast = this.hotelDetail.initData.hotelDetail.detailInfoList[2].value
                if (this.ruleForm.breakfast == '无早餐') {
                    this.ruleForm.breakfast = 0
                }
                this.ruleForm.cityName = this.hotelDetail.initData.hotelDetail.cityName
                this.ruleForm.punishmentDesc = this.hotelDetail.initData.cancellationPolicyInfo.punishmentDesc
                this.ruleForm.content = this.hotelDetail.initData.CheckinGuarantee.content
                this.ruleForm.phone = this.hotelDetail.initData.hotelDetail.tel
                this.ruleForm.invoiceInfo = this.hotelDetail.initData.invoiceInfo.state
                this.ruleForm.totalsalePrice = this.hotelDetail.initData.money.total
                console.log(this.hotelDetail.initData.money.payInfo)
                if (this.hotelDetail.initData.money.payInfo == '在线付') {
                    this.ruleForm.PaymentType = 'Prepay'
                } else {
                    this.ruleForm.PaymentType = 'SelfPay'
                }
                this.ruleForm.payInfoDesc = this.hotelDetail.initData.money.payInfoDesc
                this.ruleForm.moneyItemInfotitle = this.hotelDetail.initData.money.moneyItemInfo[0].title
                this.ruleForm.NumberOfRooms = this.hotelDetail.initData.orderInfo.list[0].text
                this.ruleForm.AffiliateConfirmationId = this.hotelDetail.initData.orderInfo.orderID
                this.ruleForm.ArrivalDate = this.time(this.hotelDetail.initData.orderInfo.checkInString)
                this.ruleForm.DepartureDate = this.time(this.hotelDetail.initData.orderInfo.checkOutString)
                this.ruleForm.Mobile = this.hotelDetail.initData.guestInfo.contact.phoneNum
                this.ruleForm.Customers = this.hotelDetail.initData.guestInfo.userInfo
                this.ruleForm.Customers.forEach(item => {
                    item.name = item.fullName
                    delete item.fullName
                })
                this.ruleForm.NumberOfCustomers = this.ruleForm.Customers.length
                this.ruleForm.hotelstar = this.hotelDetail.initData.hotelDetail.star
                this.ruleForm.address = this.hotelDetail.initData.hotelDetail.address
                console.log(this.ruleForm.totalsalePrice)
                console.log(this.ItemInfotitle(this.ruleForm.moneyItemInfotitle))
                console.log(this.ruleForm.NumberOfRooms)
                this.ruleForm.TotalPrice = (this.hotelDetail.initData.money.moneyItemInfo[0].price) / (this
                    .ItemInfotitle(this.ruleForm.moneyItemInfotitle)) / this.ruleForm.NumberOfRooms
                console.log(this.ruleForm.TotalPrice)
            },
            // 查询会员按钮
            query() {
                if (this.phoneNum.phone == '') {
                    this.$message({
                        message: '请输入手机号查询会员信息',
                        type: 'warning'
                    });
                } else {
                    this.$axios.getqueryCustomer({
                        phone: this.phoneNum.phone
                    }).then((res) => {
                        console.log(res)
                        this.huiyuan = res.data
                        this.ruleForm.customerId = this.huiyuan.customerId
                    })
                }
            },
            // 立即创建按钮
            submitForm(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        this.gethotelSelOrder()
                    } else {
                        console.log('error submit!!');
                        return false;
                    }
                });
            },
            // 创建订单接口
            gethotelSelOrder() {
                if (this.ruleForm.customerId == null) {
                    this.$message({
                        message: '请先查新会员信息',
                        type: 'warning'
                    });
                } else {
                    this.showLoading()
                    this.$axios.getcreateOrder(this.ruleForm).then((res) => {
                        this.closeLoading()
                        if (res.code == 200) {
                            console.log(res.data)
                            this.dfghdfd = res.data.hotelOrderNum;
                            console.log(this.dfghdfd);
                            this.dfghdfdList = res.data.hotelOrderId;
                            console.log(this.dfghdfdList);
                            this.$router.push({
                                name: "paya",
                                params: {
                                    huiyuan: this.huiyuan,
                                    dfghdfd: this.dfghdfd,
                                    // hghghg: this.hghghg,
                                    dfghdfdList: this.dfghdfdList,
                                    price: this.ruleForm.totalsalePrice,
                                    totalprice: this.ruleForm.totalsalePrice,
                                },
                            });
                        }
                    })
                }

            },
        },
        created() {},
        mounted() {}
    }
</script>
<style scoped>
    .Outsidemining {
        margin: 20px;
    }
</style>